<div style="padding:10px"></div>
<div class="blockcms">
    <div class="blocktitle">
        <h3 class="title">
        <?=$this->translate->_('Invoice/Receipt')?>
        </h3>
    </div>
    <div class="story" style="padding:10px">
        <div>
        <?php
        //$this->translate->_('An email has been sent to system. We will contact you soon. Thanks!')
        ?>
        </div>
        <?php
        $defaultNamespace = new Zend_Session_Namespace('Default');
        echo $this->mailBody;
        ?>
        <div style="text-align:right">
            Change Shipping:
            <?php
            $shippingType = array(
                '0' => 'Standard (5-7 Days): $0.00',
                '5.95' => 'Priority Shipping (2-3 Days): $5.95'
            );
            //echo $this->formSelect
            ?>
            <?=$this->formSelect('selectedShippingQuote', $defaultNamespace->shipping, array('onchange' => 'updateshipping(this.value);'), $shippingType)?> 
        </div>

        <div >
        <?php
        $methodPayment = $defaultNamespace->methodPayment;
        $sumWithCoupon = $defaultNamespace->sumWithCoupon;
        if($sumWithCoupon == 0) {
        ?>
            <input type="button" class="uniform" value="Complete Checkout" onclick="location.href='<?=BASE_URL?>/index/shop/processpayment'">
            <input type="button" class="uniform" value="Cancel Order">
        <?php
        } else {
            $link = BASE_URL. "/index/shop/cccheckout"; // credit card
            if ($methodPayment == 'gc') { // gift card
                $link = BASE_URL. "/index/shop/giftcardcheckout";
            } elseif($methodPayment == 'pp'){
        ?>
            <input type="button" class="uniform" value="PayPal Checkout" onclick="location.href='<?=BASE_URL?>/index/shop/processpayment'">
            <input type="button" class="uniform" value="Cancel Order">
            <!--input type="submit" class="uniform" value="Pay Now" onclick="location.href='<?=$link?>'"-->
        <?
                $link = BASE_URL. "/index/shop/paypalcheckout";
            } else {
                $link = BASE_URL. "/index/shop/cccheckout";
        ?>
    <div>
        <div style="font-size:16px">
            Credit cart checkout
        </div>
        <hr noshade="" size="1" color="#c0c0c0"/>
        
        <form action="<?=BASE_URL?>/index/shop/processpayment" method="post">
            <table>
                <tr>
                    <td width="150">
                        Cart type
                    </td>
                    <td>
                        <select class="uniform required" name="card_type" id="card_type" style="width: 230px;">
                            <option value="">-- select --</option>
                            <option value="visa">Visa</option>
                            <option value="mastercard">Mastercard</option>
                            <option value="discover">Discover</option>
                        </select>
                    </td>
                </tr>
                <tr>
                    <td width="150">
                        Credit cart number
                    </td>
                    <td>
                        <input type="text" name="cc" value="" class="required uniform">
                    </td>
                </tr>
                <tr>
                    <td width="150">
                        ShipperNo
                    </td>
                    <td>
                        <input type="text" name="ShipNo" value="" class="required uniform">
                    </td>
                </tr>
                <tr>
                    <td width="150">
                        CVV
                    </td>
                    <td>
                        <input type="text" name="CVV" value="" class="required uniform">
                    </td>
                </tr>
                <tr>
                    <td>
                        Expired date
                    </td>
                    <td>
                        <select name="monthexp">
                            <?php
                            for($i = 1; $i<=12;$i++):
                            ?>
                            <option value="<?php echo $i;?>"><?php echo $i;?></option>
                            <?php
                            endfor;
                            ?>
                        </select>
                        <select name="yearexp">
                            <?php
                            $currYear = date('Y', time());
                            for($i = $currYear; $i<=$currYear + 50;$i++):
                            ?>
                            <option value="<?php echo $i;?>"><?php echo $i;?></option>
                            <?php
                            endfor;
                            ?>
                        </select>
                    </td>
                </tr>
                <tr>
                    <td colspan="2" align="center">
                        <input type="submit" class="uniform" value="Pay Now">
                        <input type="button" class="uniform" value="Cancel Order">
                        <!--input type="submit" class="uniform" value="Pay Now" onclick="location.href='<?=$link?>'"-->
                    </td>
                </tr>
            </table>
        </form>
    </div>        
        <?php
            }
        }
        ?>
        </div>
        
        
        <div>
            <?php
            /*
            $link = BASE_URL. "/index/shop/cccheckout"; // credit card
            
            if ($methodPayment == 'gc') { // gift card
                $link = BASE_URL. "/index/shop/giftcardcheckout";
            } elseif($methodPayment == 'pp'){
                $link = BASE_URL. "/index/shop/paypalcheckout";
            } else {
                $link = BASE_URL. "/index/shop/cccheckout";
            }
            */
            ?>
        </div>
    </div>
</div>
<div style="clear: both;">&nbsp;</div>

<script>
    function updateshipping(value) {
        location.href='<?php echo BASE_URL?>/index/shop/shipping?v=' + value;
    }

</script>